package cn.ac.radi.userver.waste.util;

/**
 * 尾矿库预测（python)代码
 * python命令格式为 python predict.py D:\\yolov4-pytorch-master\test_img\GF1_8074.tif D:\yolov4-pytorch-master\geojson GF1_8074.json
 */
public class TailingPredictCommandBuilder {

    private String imagePath = "";

    public String buildCommand(String pyExePath, String pyCodeName, String inputPath, String outputPath, String jsonName){

        final String COMMAND_TEMPLATE = "{python} {code} {input} {output} {jsonName}";

        String cmd = COMMAND_TEMPLATE.replace("{python}", pyExePath)
                .replace("{code}", pyCodeName)
                .replace("{input}", inputPath)
                .replace("{output}", outputPath)
                .replace("{jsonName}", jsonName);

        return cmd.replace("\\", "/");
    }



//    /**
//     * 获得Python的Home路径
//     * @return
//     */
//    private String getPythonHome(){
//        return  env.getProperty("userver.env.python_home");
//    }

    public String getImagePath(){
        return imagePath;
    }

}

